Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Carbon CSS custom properties #2016

Merged
merged 1 commit into from
May 5, 2021

Conversation

AlanGreene
Copy link
Member

@AlanGreene AlanGreene commented Apr 29, 2021

Changes

Prereq for #1713

Enable the Carbon CSS custom properties feature flag so we can more
easily handle theming, including component-specific overrides as
needed (e.g. log container).

Replace some hard-coded background colours with the appropriate theme
tokens so they're updated correctly to match the selected theme.

Reorganise the SCSS imports so they're no longer loaded from the
individual components' JS files. This is for a number of reasons:

  • support for the CSS custom properties
  • reduce duplicate styles in output (each JS import of a SCSS file
    results in a new SASS build context rendering the import-once
    useless)
  • give consumers more control over the styles loaded

Update unit tests to account for Carbon changes in icon-only buttons
and dropdowns (they only add title attribute when text is truncated)

A future PR will introduce more easily consumable bundles of styles,
for example the PipelineRun component currently requires the
TaskTree, Task, Step, etc. styles to be loaded, so it would
make sense to provide an easily consumable SCSS import to fulfill this.

Preview of how it might look with the Carbon g90 theme:
image

Carbon g100 theme:
image

Additional work is required before this is enabled to decide on either the g90/g100 themes, ensure minimum contrast requirements are met for accessibility, ensure nav / log container boundaries are clear, etc.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide
for more details.

@AlanGreene AlanGreene mentioned this pull request Apr 29, 2021
@AlanGreene AlanGreene force-pushed the sass_reorg branch 2 times, most recently from f37b33f to 92c4127 Compare April 29, 2021 13:15
@briangleeson
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 4, 2021
@skaegi
Copy link
Contributor

skaegi commented May 4, 2021

/approve

@tekton-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: skaegi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2021
Enable the Carbon CSS custom properties feature flag so we can more
easily handle theming, including component-specific overrides as
needed (e.g. log container).

Replace some hard-coded background colours with the appropriate theme
tokens so they're updated correctly to match the selected theme.

Reorganise the SCSS imports so they're no longer loaded from the
individual components' JS files. This is for a number of reasons:
- support for the CSS custom properties
- reduce duplicate styles in output (each JS import of a SCSS file
  results in a new SASS build context rendering the `import-once`
  useless)
- give consumers more control over the styles loaded

Update unit tests to account for Carbon changes in icon-only buttons
and dropdowns (they only add title attribute when text is truncated)
A future PR will introduce more easily consumable bundles of styles,
for example the `PipelineRun` component currently requires the
`TaskTree`, `Task`, `Step`, etc. styles to be loaded, so it would
make sense to provide an easily consumable SCSS import to fulfill this.
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label May 4, 2021
@briangleeson
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label May 5, 2021
@tekton-robot tekton-robot merged commit db0e9f1 into tektoncd:main May 5, 2021
@AlanGreene AlanGreene deleted the sass_reorg branch May 5, 2021 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants